'use strict';

module.exports = app => {
  const { model } = app;
  const { INTEGER, STRING } = app.Sequelize;

  const Material = model.define(
    'Material',
    {
      id: {
        type: INTEGER,
        primaryKey: true,
        autoIncrement: true,
      },
      name: {
        type: STRING(50),
        allowNull: true,
      },
      type: {
        type: STRING(50),
        allowNull: true,
      },
      url: {
        type: STRING(255),
        allowNull: true,
      },
      description: {
        type: STRING(255),
        allowNull: true,
      },
    },
    {
      tableName: 'cms_material',
    }
  );

  Material.associate = function() {};

  return Material;
};
